function doFav(data){
	var btn = document.getElementById('favoriteBtn');
	if(data.isCollect == 1){
		data.isCollect = 0;
		btn.innerHTML = lang.live.favorite;
		
		db.del(data.id);
		
		var colType = typeList[1];
		var colDataList = colType.dataList;
		
		var j = 1;
		for(var i = 0;i<colDataList.length;i++){
			var colData = colDataList[i];
			if(colData.id == data.id){
				j = i + 1;
				colDataList.splice(i, 1);
				break;
			}
		}
		var curTypeId = navList.curItemId;
		if(curTypeId == 2){		//如果当前分类是在我的收藏下
			navList.setFocus();
			navList.curItemId = 0;
			navList.Click(2);
		}
	}else{
		data.isCollect = 1;
		btn.innerHTML = lang.live.deleteCollect;
		
		var obj = {id:data.id}
		db.insert(obj);
		
	
		var colType = typeList[1];
		
		colType.dataList.push(data);
		if(config.sortType =='number'){
			colType.dataList.sort(descByNumber );
		}else if(config.sortType == 'alphabetic'){
			colType.dataList.sort(descByAlphabetic);
		}
			
	}
}

function doLock(data){
	
	if(data.isLock){			//已经加锁
		data.isLock = false;
		lockDB.del(data.id);
		
	}else{
		data.isLock = true;
		var obj = {id:data.id};
		lockDB.insert(obj);
	}
	
}